package com.citicpub_cloud.restfull.common.constant;

/**
 * Created by dlm on 2016/4/14.
 */
public class  EnumConstant {

    /**
     *账号类型 1：邮箱，2：手机，3：微信，4：QQ，5：新浪微博 , 6:公众号
     */
    public static enum userAccountType{
        EMAIL(1),
        MOBILEPHONE(2),
        MICROMSG(3),
        QQ(4),
        SINA(5),
        GONGZHONGHAO(6);
        private int statcode;
        userAccountType(int statcode){
            this.statcode = statcode;
        }

        public int getStatcode() {
            return statcode;
        }
        
        public static  userAccountType fromValue(int statusCode){
        	userAccountType type = null;
            switch (statusCode){
                case 1:
                    type=EMAIL;
                    break;
                case 2:
                    type=MOBILEPHONE;
                    break;
                case 3:
                    type=MICROMSG;
                    break;
                case 4:
                    type=QQ;
                    break;
                case 5:
                	type=SINA;
                	break;
                default:
                    ;
            }
            return type;
        } 
    }
    /**
     *提交类型（1：保存草稿 ， 2：发布）
     */
    public static enum essaySubmitType{
        DRAFT(1),
        PUBLISH(2);

        private int statcode;
        essaySubmitType(int statcode){
            this.statcode = statcode;
        }

        public int getStatcode() {
            return statcode;
        }
    }

    /**
     * 加密类型，默认密码加密采用SHA1
     */
    public static enum CipherAlgorithm{
        SHA1("SHA-1"),
        SHA256("SHA-256"),
        AES("AES"),
        SMD5("S-MD5"),
        SSHA1("S-SHA-1"),
        SSHA256("S-SHA-256");

        final private String algorithm;

        CipherAlgorithm(final String algorithm) {
            this.algorithm = algorithm;
        }

        public final String getAlgorithm() {
            return algorithm;
        }

        public static CipherAlgorithm fromString(final String value) {
            return CipherAlgorithm.valueOf(value.toUpperCase());
        }
    }

    /**
     * 用户级别 visitor（游客）,registered_readers（注册读者）,
     * grassroots_writers（草根写手）,gold_writer（金牌写手）,
     * sign_writers(签约写手),super_writers（超级写手）
     */
    public enum userLevel{
        VISITOR("visitor"),
        REGISTERED_READERS("registered_readers"),
        GRASSROOTS_WRITERS("grassroots_writers"),
        GOLD_WRITER("gold_writer"),
        SIGN_WRITERS("sign_writers"),
        SUPER_WRITERS("super_writers");

        private String ulevel;

        userLevel(String ulevel){
            this.ulevel = ulevel;
        }

        public String getUlevel() {
            return ulevel;
        }

        public static  userLevel levelValueOf(String level){
            return userLevel.valueOf(level.toUpperCase());
        }
    }

    /**
     * 状态（0:新增  1：启用，2注销，3冻结）
     */
    public enum userStatus{
    	NEW(0),
        ACTIVITY(1),
        SUSPEND(3),
        OFF(2);

        private int statusCode;

        userStatus(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }
    }

    /**
     * '文章状态（1：待审核，2：审核失败，3：发布，4：冻结，5：草稿,6:删除，7：撤消）'
     */
    public enum essayStatus{
        /**
         * 1：待审核
         */
        PREPAREREVIEW(1),
        /**
         * 2：审核失败
         */
        REVIEWFAILED(2),
        /**
         * 3：发布
         */
        PUBLISH(3),
        /**
         * 4：冻结
         */
        OFF(4),
        /**
         * 5：草稿
         */
        DRAFT(5),

        /**
         * 删除
         */
        DELETE(6),
        /**
         * 撤消
         */
        REVERT(7);

        private int statusCode;

        essayStatus(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }
    }

    /**
     * '审核状态（0:创建状态即自身状态 1：待审核，2：审核失败，3：审核通过 , 4:撤消 ，5：删除）',
     */
    public  static enum auditStatus{
        SELFSTATUS(0),
        PREPAREREVIEW(1),
        REVIEWFAILED(2),
        REVIEWPASS(3),
        CHEXIAO(4),
        DELETE(5);

        private int statusCode;

        auditStatus(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  auditStatus fromValue(int statusCode){
            auditStatus type = null;
            switch (statusCode){
                case 0:
                    type=SELFSTATUS;
                    break;
                case 1:
                    type=PREPAREREVIEW;
                    break;
                case 2:
                    type=REVIEWFAILED;
                    break;
                case 3:
                    type=REVIEWPASS;
                    break;
                case 4:
                    type=CHEXIAO;
                    break;
                case 5:
                    type=DELETE;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 类型（1：频道，2：标签，3：文章，4：书）
     */
    public static enum auditType{
        CHANNEL(1),
        ESSAYCHANNEL(3),
        BOOK(4);

        private int statusCode;

        auditType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  auditType fromValue(int statusCode){
            auditType type = null;
            switch (statusCode){
                case 1:
                    type=CHANNEL;
                    break;
                case 3:
                    type=ESSAYCHANNEL;
                    break;
                case 4:
                    type=BOOK;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 目标类型（1：文章，3：作者）
     */
    public static enum commentTargetType{
        ESSAY(1),
        AUTH(3);

        private int statusCode;

        commentTargetType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }
    }

    /**
     * 删除类型 1：正常，2：删除
     */
    public static enum delStatus{
        NORMAL(1),
        DEL(2);

        private int statusCode;

        delStatus(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }
    }

    /**
     * 频道 '是否接受投稿 （1：接受投稿，0：不接受投稿）'
     */
    public static enum channelContribute{
        PUBLIC(1),
        PRIVATE(0);

        private int statusCode;

        channelContribute(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }
    }

    /**
     * 评论操作类型 1为撤销，2为删除
     */
    public static enum commentOprateType{
        CANCEL(1),
        DELETE(2);

        private int statusCode;

        commentOprateType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  commentOprateType fromValue(int statusCode){
            commentOprateType type = null;
            switch (statusCode){
                case 1:
                    type=CANCEL;
                    break;
                case 2:
                    type=DELETE;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 21.	获取频道 数据过滤类型//1 全部频道，2待审，3 已发布
     */
    public static enum channelQueryFiflter{
        ALL(1),
        PRERVIEW(2),
        PUBLISH(3);


        private int statusCode;

        channelQueryFiflter(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  channelQueryFiflter fromValue(int statusCode){
            channelQueryFiflter type = null;
            switch (statusCode){
                case 1:
                    type=ALL;
                    break;
                case 2:
                    type=PRERVIEW;
                    break;
                case 3:
                    type=PUBLISH;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 评论操作类型 1为撤销，2为删除
     */
    public static enum channelOprateType{
        CANCEL(1),
        DELETE(2);

        private int statusCode;

        channelOprateType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  channelOprateType fromValue(int statusCode){
            channelOprateType type = null;
            switch (statusCode){
                case 1:
                    type=CANCEL;
                    break;
                case 2:
                    type=DELETE;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 审批操作类型 1通过 2拒绝  3撤消
     */
    public static enum auditOprateType{
        CHECKPASS(1),
        REJECT(2),
        REVOKE(3);

        private int statusCode;

        auditOprateType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  auditOprateType fromValue(int statusCode){
            auditOprateType type = null;
            switch (statusCode){
                case 1:
                    type=CHECKPASS;
                    break;
                case 2:
                    type=REJECT;
                    break;
                case 3:
                    type=REVOKE;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 21.	超级写手获取文章 数据过滤类型//1 全部 ，2待审，3 已发布
     */
    public static enum essayQueryFilter{
        ALL(1),
        PRERVIEW(2),
        PUBLISH(3);


        private int statusCode;

        essayQueryFilter(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  essayQueryFilter fromValue(int statusCode){
            essayQueryFilter type = null;
            switch (statusCode){
                case 1:
                    type=ALL;
                    break;
                case 2:
                    type=PRERVIEW;
                    break;
                case 3:
                    type=PUBLISH;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 用户中心 信息维护中绑定手机与邮箱操作类型
     */
    public static enum bindType {
        PHONE(1),
        EMAIL(2);

        private int statusCode;

        bindType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  bindType fromValue(int statusCode){
            bindType type = null;
            switch (statusCode){
                case 1:
                    type=PHONE;
                    break;
                case 2:
                    type=EMAIL;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 上传的图片类型
     */
    public enum  imageType{
        HEADPHOTO(1),
        ESSAYPHOTO(2),
        OTHER(3),
        TOPICIMG(4),
    	COVERIMG(5);//图书封面
    	
        private int statusCode;

        imageType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  imageType fromValue(int statusCode){
            imageType type = null;
            switch (statusCode){
                case 1:
                    type=HEADPHOTO;
                    break;
                case 2:
                    type=ESSAYPHOTO;
                    break;
                case 3:
                    type=OTHER;
                    break;
                case 4:
                    type=TOPICIMG;
                    break;
                case 5:
                    type=COVERIMG;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 专题操作类型 1为撤销，2为删除 ，3发布
     */
    public static enum topicOprateType{
        CANCEL(1),
        DELETE(2),
        PUBLISH(3);

        private int statusCode;

        topicOprateType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  topicOprateType fromValue(int statusCode){
            topicOprateType type = null;
            switch (statusCode){
                case 1:
                    type=CANCEL;
                    break;
                case 2:
                    type=DELETE;
                    break;
                case 3:
                    type=PUBLISH;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 专题的文章操作类型 1为上移 2为下移
     */
    public static enum changeOprateType{
        UP(1),
        DOWN(2);

        private int statusCode;

        changeOprateType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  changeOprateType fromValue(int statusCode){
            changeOprateType type = null;
            switch (statusCode){
                case 1:
                    type=UP;
                    break;
                case 2:
                    type=DOWN;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 21.	超级写手获取待审批的 数据过滤类型//1 全部 ，2待审，3 审核通过，4审核拒绝
     */
    public static enum audiQueryFilter{
        ALL(1),
        PRERVIEW(2),
        CHECKPASS(3),
        REJECT(4);


        private int statusCode;

        audiQueryFilter(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  audiQueryFilter fromValue(int statusCode){
            audiQueryFilter type = null;
            switch (statusCode){
                case 1:
                    type=ALL;
                    break;
                case 2:
                    type=PRERVIEW;
                    break;
                case 3:
                    type=CHECKPASS;
                    break;
                case 4:
                    type=REJECT;
                    break;
                default:
                    ;
            }
            return type;
        }
    }

    /**
     * 合作者的状态
     * 状态（1：邀请未同意，2：正常，3：冻结）
     */
    public static enum linkChannelWriterStatus{
         UNAPPLY(1),
        NOMARL(2),
        OFF(3);


        private int statusCode;

        linkChannelWriterStatus(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  linkChannelWriterStatus fromValue(int statusCode){
            linkChannelWriterStatus type = null;
            switch (statusCode){
                case 1:
                    type=UNAPPLY;
                    break;
                case 2:
                    type=NOMARL;
                    break;
                case 3:
                    type=OFF;
                    break;
                default:
                    ;
            }
            return type;
        }
    }
    
    
    /**
     * 上传电子书文件类型
     * @author dlm
     *
     */
    public static enum bookFilesType{
        EPUB(1);


        private int statusCode;

        bookFilesType(int statusCode){
            this.statusCode = statusCode;
        }

        public int getStatusCode() {
            return statusCode;
        }

        public static  bookFilesType fromValue(int statusCode){
        	bookFilesType type = null;
            switch (statusCode){
                case 1:
                    type=EPUB;
                    break;
                default:
                    ;
            }
            return type;
        }
    }
    
    /**
     * 分析结果类型
     * @author dlm
     *
     */
    public static enum parseResultType{
    	SUCCESS(1),
    	FAILED(0);
    	
    	
    	private int statusCode;
    	
    	parseResultType(int statusCode){
    		this.statusCode = statusCode;
    	}
    	
    	public int getStatusCode() {
    		return statusCode;
    	}
    	
    	public static  parseResultType fromValue(int statusCode){
    		parseResultType type = null;
    		switch (statusCode){
    		case 0:
    			type=FAILED;
    			break;
    		case 1:
    			type=SUCCESS;
    			break;
    		default:
    			;
    		}
    		return type;
    	}
    }
}
